server:
  http_listen_port: 9080
  grpc_listen_port: 0
  grpc_server_max_recv_msg_size: 15728640
  grpc_server_max_send_msg_size: 15728640

positions:
  filename: /var/lib/loki/positions.yml
  sync_period: 30s

clients:
  - url: http://{{ hostvars['prometheus-server']['ansible_host'] }}:3100/loki/api/v1/push
    external_labels:
      all: {{ inventory_hostname }}
      ip: {{ ansible_host }}

target_config:
  sync_period: 30s

scrape_configs:
  - job_name: journal
    journal:
      max_age: 12h
      labels:
        job: systemd-journal
    relabel_configs:
      - source_labels: ['__journal__systemd_unit']
        target_label: 'unit'
  - job_name: system
    pipeline_stages:
    static_configs:
    - labels:
       job: varlogs
       host: "{{ ansible_host }}"
       __path__: /var/log/*.log
